package phase1_testCase;

import static org.junit.Assert.*;
import java.util.*;
import org.junit.Before;
import org.junit.Test;
import phase1.Dictionary; 

public class Dictionary_testCase{
	
	@Before
	public void setUp() throws Exception{
	}
	
	//test with 'a'
	@Test
	public void testGetAll(){
		boolean result = false;
		Dictionary d1 = new Dictionary();
		d1.setIndex('A');
		Vector<String> temp = new Vector<String>();
		temp = d1.getAll();
		
		for(int i = 0; i < temp.size(); i++){
			if(temp.get(i).charAt(0) == 'a')
				result = true;
			else{
				result = false; 
				break;
			}
		}			
		assertEquals(true, result);
	}
	
	//test with 'a', 'b', 'c'
	@Test
	public void testGetMaxLength(){
		int setLimit;
		Dictionary d1 = new Dictionary();
		setLimit = d1.getMaxLength('a', 'b', 'c');
		assertEquals(setLimit, 12);
	}
}